home *** CD-ROM | disk | FTP | other *** search
- Path: rover.ucs.ualberta.ca!mcbride
- From: mcbride@ee.ualberta.ca (Darin McBride)
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
- Subject: Re: Hungarian notation
- Date: 16 Jan 1996 19:53:50 GMT
- Organization: University of Alberta Electrical Engineering Department
- Message-ID: <4dgvoe$10si@pulp.ucs.ualberta.ca>
- References: <cmanDK7x13.5KM@netcom.com>
- NNTP-Posting-Host: hp02.ee.ualberta.ca
- X-Newsreader: TIN [version 1.2 PL2]
-
- Mike Austin (cman@netcom.com) wrote:
- > 3ga$80a@beatty.slip.netcom.com> <30DC677A.5116@zeta.org.au> <4bhf24$adq@beatty.slip.netcom.com> <30E0E51A.5A4F@zeta.org.au>
- > Organization: NETCOM On-line Communication Services (408 261-4700 guest)
-
- > I'm sorry to butt in, but I've found that prefixing variables with their
- > scope is much more usable than their type. For example:
-
- > int gGlobal;
- > int sStatic;
- > int mMember;
- > int aArgument;
- > int vVolitile;
-
- > Var = mVar = aVar;
-
- > Don't know if anyone else does this, but if you ever get lost in code,
- > you will know where these variables are declared.
-
- We use a similar method, although we combine the two forms. For
- example:
-
- int g_nGlobal;
- char* m_pszMember;
-
- etc. For local variables, we omit the prefix because most variables end
- up being local.
-
- --
- Darin McBride:mcbride@ee.ualberta.ca/mcbride@tower.bohica.net
-
- Enjoy each day as if it were your last, care about each moment as if
- it were your last for one day, one moment, you *will* be right!
-
- Tips & Tricks for IBM Hardware, MSDOS, OS2, Windows (including Win'95):
- http://www.ee.ualberta.ca/~mcbride/tiptrick.html
-